package edu.auctionmart

import static org.junit.Assert.*
import org.junit.*

class PreferencesIntegrationTests {

	void testPreferences() {
		Preferences testPreference = new Preferences(smsShouldAlert: true, ivrShouldAlert: true, emailShouldAlert: true, smsNumber: 2074503879, ivrNumber: 2074503879, emailAlertAddress: "rhgillen@gmail.com")
		
		Preferences badPreference = new Preferences(smsShouldAlert: true, ivrShouldAlert: true, emailShouldAlert: true, smsNumber: 207879, ivrNumber: 2074503879, emailAlertAddress: "rhgillen@gmail.com")
		
		testPreference.save()
		badPreference.save()
		
		def preferenceFound = Preferences.get(testPreference.id)
		assertNotNull(preferenceFound)
		
		def preferenceNotFound = Preferences.get(badPreference.id)
		assertNull(preferenceNotFound)
	}
}